<!DOCTYPE html>
<html lang="en"
     xmlns="http://www.w3.org/1999/xhtml"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
>
	<head>
		<title>Admin</title>
		<meta charset="utf-8" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!--basic styles-->
		<link href="#{request.contextPath}/resources/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link href="#{request.contextPath}/resources/assets/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="#{request.contextPath}/resources/assets/css/font-awesome.min.css" />

		<!--fonts-->
		<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />

		<!--ace styles-->
		<link rel="stylesheet" href="#{request.contextPath}/resources/assets/css/ace.min.css" />
		<link rel="stylesheet" href="#{request.contextPath}/resources/assets/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="#{request.contextPath}/resources/assets/css/ace-skins.min.css" />
		
		<!--basic scripts-->
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
		<script src="#{request.contextPath}/resources/assets/js/jquery-2.0.3.min.js"></script>
		<script src="#{request.contextPath}/resources/assets/js/bootstrap.min.js"></script>
		<script src="#{request.contextPath}/resources/assets/js/ace-elements.min.js"></script>
		<script src="#{request.contextPath}/resources/assets/js/ace.min.js"></script>
		
		<script type="text/javascript">
		$(document).ready(function(){
			
			var link = window.location.href;
			link = link.split('/');
			var page_name = link[link.length-1];
			page_name = (page_name.split('.'))[0];
			$('ul.submenu li').each(
					function(){
						var href = $(this).find('a').attr('href');
						href = (href.split('.'))[0];
						href = href.split('/');
						href = href[href.length-1];
						href = (href.split('.'))[0];
						console.log(href+" "+page_name);
						if(href == page_name){
							$('a').removeClass('active');
							$('li').removeClass('active open');
							$(this).addClass('active open');
							$(this).parent('ul.submenu').show();
							$(this).parent('li').addClass("active open");
							$(this).parent('ul.submenu').parent('li').addClass("active open");
						}
					});
		})
		</script>
		
	</head>
	<body> 
		<div class="navbar">
			<ui:insert name="header" >
				<ui:include src="header.xhtml" />
		   	</ui:insert>
		</div>
		<div class="main-container container-fluid">
			<a class="menu-toggler" id="menu-toggler" href="#">
				<span class="menu-text"></span>
			</a>
			<ui:insert name="menu-bar" >
				<ui:include src="menubar.xhtml" />
		   	</ui:insert>

			<div class="main-content">
				<ui:insert name="menu-bar" >
					<ui:include src="nav-search.xhtml" />
			   	</ui:insert>
				<div class="page-content">
					<div class="row-fluid">
						<div class="span12">
							<!--PAGE CONTENT BEGINS-->
							<ui:insert name="main-content">
							</ui:insert>
							<!--PAGE CONTENT ENDS-->
						</div><!--/.span-->
					</div><!--/.row-fluid-->
				</div><!--/.page-content-->

			</div><!--/.main-content-->
		</div><!--/.main-container-->

		<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-small btn-inverse">
			<i class="icon-double-angle-up icon-only bigger-110"></i>
		</a>
	</body>
</html>
